import request from '@/utils/request';


export async function fetchUserList(params) {
  return request(
    `/api/user?load=streets&page=1&limit=${params.limit}&offset=${params.offset}${params.search}`,
  );
}



export async function fetchStreets() {
  return request(`/api/street`);
}



export async function fetch(params) {
  return request(`/api/user?load=gateways&page=1&load=user&limit=${params.limit}&offset=${params.offset}${params.search}`);
}


export async function AddUser(params) {
  return request('/api/user', {
    method: 'POST',
    data: params,
  })
}
export async function DeleteUser(params) {
  return request(`/api/user/${params.Id}`, {
    method: 'PUT',
    data: params,
  })
}

export async function FetchUser(params) {
  return request(`/api/user?load=gateways&query=id:${params.Id}`);
}


export async function UpdateUser(params) {
  return request(`/api/user/${params.Id}`, {
    method: 'PUT',
    data: params,
  })
}